import org.apache.cxf.endpoint.Server;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

public class SOAPServer {

	public SOAPServer()
	{
		JaxWsServerFactoryBean svrFactory1 = new JaxWsServerFactoryBean();
		Server createProjectServer;
		svrFactory1.setServiceClass(CreateProjectService.class);
		svrFactory1.setAddress("http://localhost:63081/createProject");
		svrFactory1.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory1.getOutInterceptors().add(new LoggingOutInterceptor());
		createProjectServer = svrFactory1.create();
		createProjectServer.start();

		JaxWsServerFactoryBean svrFactory2 = new JaxWsServerFactoryBean();
		Server uploadDocumentServer;
		svrFactory2.setServiceClass(UploadDocumentService.class);
		svrFactory2.setAddress("http://localhost:63081/uploadDocument");
		svrFactory2.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory2.getOutInterceptors().add(new LoggingOutInterceptor());
		uploadDocumentServer = svrFactory2.create();
		uploadDocumentServer.start();

		JaxWsServerFactoryBean svrFactory3 = new JaxWsServerFactoryBean();
		Server saveInDBServer;
		svrFactory3.setServiceClass(SaveInDBService.class);
		svrFactory3.setAddress("http://localhost:63081/saveInDB");
		svrFactory3.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory3.getOutInterceptors().add(new LoggingOutInterceptor());
		saveInDBServer = svrFactory3.create();
		saveInDBServer.start();

		JaxWsServerFactoryBean svrFactory4 = new JaxWsServerFactoryBean();
		Server expectedEarningsServer;
		svrFactory4.setServiceClass(ExpectedEarningsService.class);
		svrFactory4.setAddress("http://localhost:63081/expectedEarnings");
		svrFactory4.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory4.getOutInterceptors().add(new LoggingOutInterceptor());
		expectedEarningsServer = svrFactory4.create();
		expectedEarningsServer.start();

		JaxWsServerFactoryBean svrFactory5 = new JaxWsServerFactoryBean();
		Server deleteProjectServer;
		svrFactory5.setServiceClass(DeleteProjectService.class);
		svrFactory5.setAddress("http://localhost:63081/deleteProject");
		svrFactory5.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory5.getOutInterceptors().add(new LoggingOutInterceptor());
		deleteProjectServer = svrFactory5.create();
		deleteProjectServer.start();

		JaxWsServerFactoryBean svrFactory6 = new JaxWsServerFactoryBean();
		Server calculateDifferencesServer;
		svrFactory6.setServiceClass(CalculateDifferencesService.class);
		svrFactory6.setAddress("http://localhost:63081/calculateDifferences");
		svrFactory6.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory6.getOutInterceptors().add(new LoggingOutInterceptor());
		calculateDifferencesServer = svrFactory6.create();
		calculateDifferencesServer.start();

		JaxWsServerFactoryBean svrFactory7 = new JaxWsServerFactoryBean();
		Server earningsAndPriceServer;
		svrFactory7.setServiceClass(CalculatePriceService.class);
		svrFactory7.setAddress("http://localhost:63081/calculatePrice");
		svrFactory7.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory7.getOutInterceptors().add(new LoggingOutInterceptor());
		earningsAndPriceServer = svrFactory7.create();
		earningsAndPriceServer.start();

		JaxWsServerFactoryBean svrFactory8 = new JaxWsServerFactoryBean();
		Server sendOrderServer;
		svrFactory8.setServiceClass(SendOrderService.class);
		svrFactory8.setAddress("http://localhost:63081/sendOrder");
		svrFactory8.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory8.getOutInterceptors().add(new LoggingOutInterceptor());
		sendOrderServer = svrFactory8.create();
		sendOrderServer.start();

		JaxWsServerFactoryBean svrFactory9 = new JaxWsServerFactoryBean();
		Server projectContainerServer;
		svrFactory9.setServiceClass(ProjectContainerService.class);
		svrFactory9.setAddress("http://localhost:63081/projectContainer");
		svrFactory9.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory9.getOutInterceptors().add(new LoggingOutInterceptor());
		projectContainerServer = svrFactory9.create();
		projectContainerServer.start();

		JaxWsServerFactoryBean svrFactory10 = new JaxWsServerFactoryBean();
		Server sendComplaintServer;
		svrFactory10.setServiceClass(SendComplaintService.class);
		svrFactory10.setAddress("http://localhost:63081/sendComplaints");
		svrFactory10.getInInterceptors().add(new LoggingInInterceptor());
		svrFactory10.getOutInterceptors().add(new LoggingOutInterceptor());
		sendComplaintServer = svrFactory10.create();
		sendComplaintServer.start();
	}
}
